home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000229_icon-group-sender _Wed Nov 10 09:44:51 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
5KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA29118
for icon-group-addresses; Wed, 10 Nov 1999 09:42:51 -0700 (MST)
Message-Id: <199911101642.JAA29118@baskerville.CS.Arizona.EDU>
X-Authentication-Warning: agate.berkeley.edu: news set sender to <news> using -f
From: Anders Holtsberg <andersh@maths.lth.se>
X-Newsgroups: comp.lang.icon
Subject: List question
Date: Wed, 10 Nov 1999 10:17:23 +0100
X-Accept-Language: en
To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
--------------2D064CE7C06019CDC4A897F9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
A string can be changed in place
s[4:6] = " hello "
A list can be appended at the end and at the beginning
every put(listA, !listB)
But does the language definition forbid
listA[5+:0] := listB
or what is the handy way to delete and insert elements
in a list supplied as an argument? If I have
procedure f(mylist)
put(mylist, "hello") # This is OK
mylist[5+:0] := ["hello"] # Run time error. The book states
# that run time error is indeed expected.
mylist := mylist[1:5] ||| ["hello"] ||| mylist[5:0] # Here the
caller is not affected!
1) Have I understood? Is it impossible to write a routine
listinsert(A,B,i)
and that we have to write A:=listinsert(A,B,i)
2) What was the language design objectives to rule out
listA[i:j] := listB
There is no semantic problem , listA[i] is an element and
listA[i+:1] is a
sublist (or rather today only a list of its own since it cannot be
a left-value).
3) I figure there are dark corners here since I saw in a list library
that
mr Griswold himself thought about the difficulties in
similarity/differences
between string filosophy and list filosophy.
Comments anybody?
(the code is from top of my head, I only have Icon at home just now)
Andy
--
__________________________________________________________________
Anders Holtsberg Matematisk statistik Telefon 046-2224953
andersh@maths.lth.se Matematikcentrum Telefax 046-2224998
www.maths.lth.se Lunds universitet Box 118, 22100 Lund
--------------2D064CE7C06019CDC4A897F9
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<br>A string can be changed in place
<p> s[4:6] = " hello "
<p>A list can be appended at the end and at the beginning
<p> every put(listA, !listB)
<p>But does the language definition forbid
<p> listA[5+:0] := listB
<p>or what is the handy way to delete and insert elements
<br>in a list supplied as an argument? If I have
<p> procedure f(mylist)
<p> put(mylist, "hello") # This is OK
<br> mylist[5+:0] := ["hello"] # Run time error.
The book states
<br> # that run time error is indeed expected.
<br> mylist := mylist[1:5] ||| ["hello"] ||| mylist[5:0]
# Here the caller is not affected!
<p>1) Have I understood? Is it impossible to write a routine listinsert(A,B,i)
<br> and that we have to write A:=listinsert(A,B,i)
<br>2) What was the language design objectives to rule out
<br>
listA[i:j] := listB
<br> There is no semantic problem , listA[i]
is an element and listA[i+:1] is a
<br> sublist (or rather today only a list
of its own since it cannot be a left-value).
<br>3) I figure there are dark corners here since I saw in a list library
that
<br> mr Griswold himself thought about the difficulties
in similarity/differences
<br> between string filosophy and list filosophy.
<p>Comments anybody?
<p>(the code is from top of my head, I only have Icon at home just now)
<p>Andy
<pre>--
__________________________________________________________________
Anders Holtsberg Matematisk statistik Telefon 046-2224953
andersh@maths.lth.se Matematikcentrum Telefax 046-2224998
www.maths.lth.se Lunds universitet Box 118, 22100 Lund</pre>
</html>
--------------2D064CE7C06019CDC4A897F9--